import React, { Component } from 'react'
//import qs from 'querystring'
const detale=[
    {id:"01",content:"11111"},
    {id:"02",content:"22222"},
    {id:"03",content:"33333"}
]
export default class Ditel extends Component {
    
    render() {
        // const {id,title}=this.props.match.params
       // const {id,title}=qs.parse((this.props.location.search).slice(1))
       const {id,title}=this.props.location.state || {}
        const contentobj=detale.find((detaleobj)=>{
            return detaleobj.id===id

        }) || {}
        return (
            <div>
                <ul>
                    <li>id:{id}</li>
                    <li>title:{title}</li>
                    <li>content:{contentobj!=null?contentobj.content :"wu"}</li>
                </ul>
            </div>
        )
    }
}
